import { languageTitle } from "@/lang/lang_config"
// translate router.meta.title, be used in breadcrumb sidebar tagsview
export function generateTitle(title) {
  const hasKey = this.$te('route.' + title)
  let sidebarTitle = languageTitle

  if (hasKey) {
    // $t :this method from vue-i18n, inject in @/lang/index.js
    const translatedTitle = this.$t('route.' + title)

    return translatedTitle
  }
  title = sidebarTitle.filter((item) => item.name == title)[0].title

  return this.$t(title)
}